package com.meiyue.bean.entity;

import javax.persistence.*;
import java.sql.Timestamp;

/**
 * MeiyueJavaProject
 * com.meiyue.bean.entity
 * Created by Chris Chen
 * 2017/9/14
 * Explain:
 */
@Entity
@Table(name = "test_service_places", schema = "test_yuedao", catalog = "")
public class TestServicePlacesEntity {
    private int id;
    private String placeFullName;
    private String placeShortName;
    private String placeAddress;
    private int placeLongitude;
    private int placeLatitude;
    private String licenseKey;
    private Timestamp registrationDatetime;
    private String phone;
    private Integer fax;
    private Integer ratingId;
    private int placeProvinceId;
    private int placeCityId;
    private String description;

    @Id
    @Column(name = "id", nullable = false)
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "place_full_name", nullable = false, length = 100)
    public String getPlaceFullName() {
        return placeFullName;
    }

    public void setPlaceFullName(String placeFullName) {
        this.placeFullName = placeFullName;
    }

    @Basic
    @Column(name = "place_short_name", nullable = false, length = 100)
    public String getPlaceShortName() {
        return placeShortName;
    }

    public void setPlaceShortName(String placeShortName) {
        this.placeShortName = placeShortName;
    }

    @Basic
    @Column(name = "place_address", nullable = false, length = 200)
    public String getPlaceAddress() {
        return placeAddress;
    }

    public void setPlaceAddress(String placeAddress) {
        this.placeAddress = placeAddress;
    }

    @Basic
    @Column(name = "place_longitude", nullable = false)
    public int getPlaceLongitude() {
        return placeLongitude;
    }

    public void setPlaceLongitude(int placeLongitude) {
        this.placeLongitude = placeLongitude;
    }

    @Basic
    @Column(name = "place_latitude", nullable = false)
    public int getPlaceLatitude() {
        return placeLatitude;
    }

    public void setPlaceLatitude(int placeLatitude) {
        this.placeLatitude = placeLatitude;
    }

    @Basic
    @Column(name = "license_key", nullable = false, length = 16)
    public String getLicenseKey() {
        return licenseKey;
    }

    public void setLicenseKey(String licenseKey) {
        this.licenseKey = licenseKey;
    }

    @Basic
    @Column(name = "registration_datetime", nullable = true)
    public Timestamp getRegistrationDatetime() {
        return registrationDatetime;
    }

    public void setRegistrationDatetime(Timestamp registrationDatetime) {
        this.registrationDatetime = registrationDatetime;
    }

    @Basic
    @Column(name = "phone", nullable = true, length = 20)
    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    @Basic
    @Column(name = "fax", nullable = true)
    public Integer getFax() {
        return fax;
    }

    public void setFax(Integer fax) {
        this.fax = fax;
    }

    @Basic
    @Column(name = "rating_id", nullable = true)
    public Integer getRatingId() {
        return ratingId;
    }

    public void setRatingId(Integer ratingId) {
        this.ratingId = ratingId;
    }

    @Basic
    @Column(name = "place_province_id", nullable = false)
    public int getPlaceProvinceId() {
        return placeProvinceId;
    }

    public void setPlaceProvinceId(int placeProvinceId) {
        this.placeProvinceId = placeProvinceId;
    }

    @Basic
    @Column(name = "place_city_id", nullable = false)
    public int getPlaceCityId() {
        return placeCityId;
    }

    public void setPlaceCityId(int placeCityId) {
        this.placeCityId = placeCityId;
    }

    @Basic
    @Column(name = "description", nullable = true, length = 1000)
    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        TestServicePlacesEntity that = (TestServicePlacesEntity) o;

        if (id != that.id) return false;
        if (placeLongitude != that.placeLongitude) return false;
        if (placeLatitude != that.placeLatitude) return false;
        if (placeProvinceId != that.placeProvinceId) return false;
        if (placeCityId != that.placeCityId) return false;
        if (placeFullName != null ? !placeFullName.equals(that.placeFullName) : that.placeFullName != null)
            return false;
        if (placeShortName != null ? !placeShortName.equals(that.placeShortName) : that.placeShortName != null)
            return false;
        if (placeAddress != null ? !placeAddress.equals(that.placeAddress) : that.placeAddress != null) return false;
        if (licenseKey != null ? !licenseKey.equals(that.licenseKey) : that.licenseKey != null) return false;
        if (registrationDatetime != null ? !registrationDatetime.equals(that.registrationDatetime) : that.registrationDatetime != null)
            return false;
        if (phone != null ? !phone.equals(that.phone) : that.phone != null) return false;
        if (fax != null ? !fax.equals(that.fax) : that.fax != null) return false;
        if (ratingId != null ? !ratingId.equals(that.ratingId) : that.ratingId != null) return false;
        if (description != null ? !description.equals(that.description) : that.description != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id;
        result = 31 * result + (placeFullName != null ? placeFullName.hashCode() : 0);
        result = 31 * result + (placeShortName != null ? placeShortName.hashCode() : 0);
        result = 31 * result + (placeAddress != null ? placeAddress.hashCode() : 0);
        result = 31 * result + placeLongitude;
        result = 31 * result + placeLatitude;
        result = 31 * result + (licenseKey != null ? licenseKey.hashCode() : 0);
        result = 31 * result + (registrationDatetime != null ? registrationDatetime.hashCode() : 0);
        result = 31 * result + (phone != null ? phone.hashCode() : 0);
        result = 31 * result + (fax != null ? fax.hashCode() : 0);
        result = 31 * result + (ratingId != null ? ratingId.hashCode() : 0);
        result = 31 * result + placeProvinceId;
        result = 31 * result + placeCityId;
        result = 31 * result + (description != null ? description.hashCode() : 0);
        return result;
    }
}
